{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "df_recent['dayofweek'] = df_recent.index.dayofweek\n",
    "\n",
    "def get_up_down_count(df, weekday):\n",
    "    df1 = df_recent[df_recent['dayofweek'] == weekday]\n",
    "    return('总共:',len(df1),'涨',len(df1[df['close-open'] > 0]), len(df1[df['close-open'] < 0]), len(df1[df['close-open'] == 0]))\n",
    "    \n",
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
